/******************************************************************************/
/* @ All Rights Reserved Copyright (C) 2015 broada,Ltd.                       */
/*                                                                            */
/*  NAME      = shortTCP_init.c                                               */
/*  NOTE      =                                                               */
/*  DATE      = 2015/01/30 by geyh                                            */
/******************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "frcomm.h"
#include "frmem.h"
#include "frstr.h"

#include "conntrack.h"
#include "module.h"
#include "frversion.h"

#include "config.h"
#include "shortTCP_core.h"

int module_init(void *p_context, const char* p_module_params, L7_module_config *p_module_cfg)
{
    int i_ret_fun = FR_SUCC;
    
    if(p_context == NULL || p_module_params == NULL || p_module_cfg == NULL)
        return FR_FAIL;
    
    if( fr_slab_init( (Frmem_env *)(((ApmContext *)p_context)->p_st_mem_env), MODULE_NAME) == NULL )
    {
        return FR_FAIL;
    }
    
    p_module_cfg->p_l4_proto = MODULE_L4PROTO;
    p_module_cfg->i_l7_proto = MODULE_L7PROTO;
    p_module_cfg->p_module_name = MODULE_NAME;
    p_module_cfg->p_version = MODULE_VERSION " " MODULE_TIME;
    p_module_cfg->l7_detect = shortTCP_detect;
    p_module_cfg->l7_analysis = shortTCP_data_analysis;
    p_module_cfg->session_destory = shortTCP_session_destroy;
    
    return FR_SUCC;
}

/*******************************************************************************
*  FUNC     :  shortTCP销毁
*  ARGS     :  void
*  RTN      :
*  NOTE     :
*******************************************************************************/
void module_exit(void)
{
    frdbg("shortTCP_destroy\n");
    fr_slab_destroy();

    return;
}
